package models;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils;

public class Updates implements Serializable {
    private Integer updates_id;
    private String name;
    private String update;
    private Date created_date;
    
    private Integer user_id;
    private String firstname;
    private String lastname;
    private String photo;
    private String username;
    private String notices;
    private String str_date;
    private Integer journey_id;
    private Integer position_id;
    private Integer user_shared_id;
    private Integer share_id;
    private Integer type_id;
    private Integer type;
    public String getStrDate(){
        Date now = new Date();
        if(DateUtils.isSameDay(created_date, now)){
            return "Today";
        }
        return DateFormatUtils.format(created_date, "yyyy/MM/dd");
    }
    
    public String getStrTime(){
        return DateFormatUtils.format(created_date, "HH:mm");
    }
    
    public int getUpdates_id() {
        return updates_id;
    }
    public void setUpdates_id(int updates_id) {
        this.updates_id = updates_id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getUpdate() {
        return update;
    }
    public void setUpdate(String update) {
        this.update = update;
    }
    public Date getCreated_date() {
        return created_date;
    }
    public void setCreated_date(Date created_date) {
        this.created_date = created_date;
    }
    public Integer getUser_id() {
        return user_id;
    }
    public void setUser_id(Integer user_id) {
        this.user_id = user_id;
    }
    public String getFirstname() {
        return firstname;
    }
    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }
    public String getLastname() {
        return lastname;
    }
    public void setLastname(String lastname) {
        this.lastname = lastname;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    public void setUpdates_id(Integer updates_id) {
        this.updates_id = updates_id;
    }

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getNotices() {
		return notices;
	}

	public void setNotices(String notices) {
		this.notices = notices;
	}

	public String getStr_date() {
		return str_date;
	}

	public void setStr_date(String str_date) {
		this.str_date = str_date;
	}

	public Integer getJourney_id() {
		return journey_id;
	}

	public void setJourney_id(Integer journey_id) {
		this.journey_id = journey_id;
	}

	public Integer getUser_shared_id() {
		return user_shared_id;
	}

	public void setUser_shared_id(Integer user_shared_id) {
		this.user_shared_id = user_shared_id;
	}

	public Integer getShare_id() {
		return share_id;
	}

	public void setShare_id(Integer share_id) {
		this.share_id = share_id;
	}

	public Integer getPosition_id() {
		return position_id;
	}

	public void setPosition_id(Integer position_id) {
		this.position_id = position_id;
	}

	public Integer getType_id() {
		return type_id;
	}

	public void setType_id(Integer type_id) {
		this.type_id = type_id;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
    
    
}
